<template>
  <view class="ota-video-preview">
    <template v-if="urlList?.length > 0">
      <ve-video class="video-item" :url="url" v-for="(url, index) in urlList" :key="index" />
    </template>
    <view class="empty-block" v-else>
      <view class="empty-block-wrap">
        <view class="empty-block-inner">
          <ve-image src="empty" class="empty_img" width="64" height="64" />
          <p class="empty_text">暂无数据</p>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
  const props = defineProps({
    urlList: {
      type: Array,
      default: () => [],
    },
  })
</script>

<style lang="less" scoped>
  .empty-block {
    width: 100%;
    padding-bottom: 56.25%;
    position: relative;
    .empty-block-wrap {
      position: absolute;
      width: 100%;
      height: 100%;
      left: 0;
      top: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4rpx 4rpx 4rpx 4rpx;
      text-align: center;
      background: #f2f3f5;
      border: 1px solid #e2e2e2;
      font-size: 24rpx;
      color: #b6b6b6;
      line-height: 40rpx;
    }
  }
</style>
